/*
 * XML Type:  BillDetailTable
 * Namespace: http://ofx.net/types/2003/04
 * Java type: net.ofx.types.x2003.x04.BillDetailTable
 *
 * Automatically generated - do not modify.
 */
package net.ofx.types.x2003.x04.impl;
/**
 * An XML BillDetailTable(@http://ofx.net/types/2003/04).
 *
 * This is a complex type.
 */
public class BillDetailTableImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements net.ofx.types.x2003.x04.BillDetailTable
{
    
    public BillDetailTableImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName TABLENAME$0 = 
        new javax.xml.namespace.QName("", "TABLENAME");
    private static final javax.xml.namespace.QName BILLDETAILTABLETYPE$2 = 
        new javax.xml.namespace.QName("", "BILLDETAILTABLETYPE");
    private static final javax.xml.namespace.QName BILLDETAILROW$4 = 
        new javax.xml.namespace.QName("", "BILLDETAILROW");
    
    
    /**
     * Gets the "TABLENAME" element
     */
    public java.lang.String getTABLENAME()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(TABLENAME$0, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "TABLENAME" element
     */
    public net.ofx.types.x2003.x04.GenericNameType xgetTABLENAME()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.GenericNameType target = null;
            target = (net.ofx.types.x2003.x04.GenericNameType)get_store().find_element_user(TABLENAME$0, 0);
            return target;
        }
    }
    
    /**
     * Sets the "TABLENAME" element
     */
    public void setTABLENAME(java.lang.String tablename)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(TABLENAME$0, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(TABLENAME$0);
            }
            target.setStringValue(tablename);
        }
    }
    
    /**
     * Sets (as xml) the "TABLENAME" element
     */
    public void xsetTABLENAME(net.ofx.types.x2003.x04.GenericNameType tablename)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.GenericNameType target = null;
            target = (net.ofx.types.x2003.x04.GenericNameType)get_store().find_element_user(TABLENAME$0, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.GenericNameType)get_store().add_element_user(TABLENAME$0);
            }
            target.set(tablename);
        }
    }
    
    /**
     * Gets the "BILLDETAILTABLETYPE" element
     */
    public java.lang.String getBILLDETAILTABLETYPE()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(BILLDETAILTABLETYPE$2, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "BILLDETAILTABLETYPE" element
     */
    public net.ofx.types.x2003.x04.GenericNameType xgetBILLDETAILTABLETYPE()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.GenericNameType target = null;
            target = (net.ofx.types.x2003.x04.GenericNameType)get_store().find_element_user(BILLDETAILTABLETYPE$2, 0);
            return target;
        }
    }
    
    /**
     * Sets the "BILLDETAILTABLETYPE" element
     */
    public void setBILLDETAILTABLETYPE(java.lang.String billdetailtabletype)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(BILLDETAILTABLETYPE$2, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(BILLDETAILTABLETYPE$2);
            }
            target.setStringValue(billdetailtabletype);
        }
    }
    
    /**
     * Sets (as xml) the "BILLDETAILTABLETYPE" element
     */
    public void xsetBILLDETAILTABLETYPE(net.ofx.types.x2003.x04.GenericNameType billdetailtabletype)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.GenericNameType target = null;
            target = (net.ofx.types.x2003.x04.GenericNameType)get_store().find_element_user(BILLDETAILTABLETYPE$2, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.GenericNameType)get_store().add_element_user(BILLDETAILTABLETYPE$2);
            }
            target.set(billdetailtabletype);
        }
    }
    
    /**
     * Gets array of all "BILLDETAILROW" elements
     */
    public net.ofx.types.x2003.x04.BillDetailRow[] getBILLDETAILROWArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(BILLDETAILROW$4, targetList);
            net.ofx.types.x2003.x04.BillDetailRow[] result = new net.ofx.types.x2003.x04.BillDetailRow[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "BILLDETAILROW" element
     */
    public net.ofx.types.x2003.x04.BillDetailRow getBILLDETAILROWArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.BillDetailRow target = null;
            target = (net.ofx.types.x2003.x04.BillDetailRow)get_store().find_element_user(BILLDETAILROW$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "BILLDETAILROW" element
     */
    public int sizeOfBILLDETAILROWArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(BILLDETAILROW$4);
        }
    }
    
    /**
     * Sets array of all "BILLDETAILROW" element
     */
    public void setBILLDETAILROWArray(net.ofx.types.x2003.x04.BillDetailRow[] billdetailrowArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(billdetailrowArray, BILLDETAILROW$4);
        }
    }
    
    /**
     * Sets ith "BILLDETAILROW" element
     */
    public void setBILLDETAILROWArray(int i, net.ofx.types.x2003.x04.BillDetailRow billdetailrow)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.BillDetailRow target = null;
            target = (net.ofx.types.x2003.x04.BillDetailRow)get_store().find_element_user(BILLDETAILROW$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(billdetailrow);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "BILLDETAILROW" element
     */
    public net.ofx.types.x2003.x04.BillDetailRow insertNewBILLDETAILROW(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.BillDetailRow target = null;
            target = (net.ofx.types.x2003.x04.BillDetailRow)get_store().insert_element_user(BILLDETAILROW$4, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "BILLDETAILROW" element
     */
    public net.ofx.types.x2003.x04.BillDetailRow addNewBILLDETAILROW()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.BillDetailRow target = null;
            target = (net.ofx.types.x2003.x04.BillDetailRow)get_store().add_element_user(BILLDETAILROW$4);
            return target;
        }
    }
    
    /**
     * Removes the ith "BILLDETAILROW" element
     */
    public void removeBILLDETAILROW(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(BILLDETAILROW$4, i);
        }
    }
}
